const int led1=8; const int led2=7; const int button=3; void setup() { // put your setup code here, to run once: pinMode(led1,OUTPUT); // initialize digital pin 8 as an output. pinMode(led2,OUTPUT); // initialize digital pin 7 as an output. pinMode(button,INPUT); // initialize digital pin 3 as an input. } void loop() { // put your main code here, to run repeatedly: if (digitalRead(button)==HIGH) // read the input pin: { digitalWrite(led2,HIGH);// turn the LED on (HIGH is the voltage level) } else if (digitalRead(button)==LOW) // read the input pin: { digitalWrite(led2,LOW);// turn the LED off (LOW is the voltage level) } }